import { MyRequest, request } from '@/plugins'

export const login = <T>(data: Login) => request<T>({ method: 'post', url: '/api/v1/vul/login', data })
export const logout = () => request({ method: 'delete', url: '/api/v1/vul/logout' })
export const updatePassword = (data: UpdatePassword) => request({ method: 'put', url: '/api/v1/vul/password', data })
export const getUserList = <T = GetUserListResponse>(params: GetUserListParams) =>
  request<T>({ method: 'get', url: '/api/v1/vul/users', params })
export const register = <T>(data: any) => request<T>({ method: 'post', url: '/api/v1/vul/users', data })
export const updateUser = <T>(data: any) => request<T>({ method: 'put', url: '/api/v1/vul/users', data })
export const getUsers = () => MyRequest<Users>({ method: 'get', url: '/api/v1/vul/leak/mapping/user' })